#include	"ControlGroup.h"

ControlGroup::ControlGroup()
	:	m_control()
{
}

ControlGroup::~ControlGroup()
{
	for(std::list< IControl * >::iterator it = m_control.begin();
		it != m_control.end(); ++it)
	{
		delete (*it);
	}
	m_control.clear();
}

void ControlGroup::update(double delay)
{
	for(std::list< IControl * >::iterator it = m_control.begin();
		it != m_control.end(); ++it)
	{
		(*it)->update(delay);
	}
}

void ControlGroup::render() const
{
	for(std::list< IControl * >::const_iterator it = m_control.begin();
		it != m_control.end(); ++it)
	{
		(*it)->render();
	}
}

void ControlGroup::add(IControl * control)
{
	m_control.push_back(control);
}

